﻿using GalaSoft.MvvmLight.Messaging;
using KINLO.DRV.Machine;
using KINLO.Model.InfoModel;
using KINLO.UI.Main.Services;
using KINLO.UI.Main.VM;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace KINLO.UI.Main
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        MainVM viewModel;
        public MainWindow()
        {
            InitializeComponent();
            viewModel = new MainVM(this);
            this.DataContext = viewModel; 

        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!(MessageBoxResult.OK == MessageBox.Show("确认关闭系统", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Information)))
            {
                e.Cancel = true;
            }
            else
            {
                //关机调用产量接口
                // Messenger.Default.Send("6", "UpdateTeamShiftAndWorkOrder");
               
                Messenger.Default.Send("关机", "CloseCount");

            }
        }
    }
}
